package yh;

/**
 * 逻辑运算符
 */
public class LogicalOperator {
    public static void main(String[] args) {
        System.out.println("逻辑与：");
        System.out.println(true&true);
        System.out.println(false&false);
        System.out.println(true&false);
        System.out.println(false&true);

        System.out.println("短路与：");
        System.out.println(true&&true);
        System.out.println(false&&false);
        System.out.println(true&&false);
        System.out.println(false&&true);

        System.out.println("逻辑或：");
        System.out.println(true|true);
        System.out.println(false|false);
        System.out.println(true|false);
        System.out.println(false|true);

        System.out.println("短路或：");
        System.out.println(true||true);
        System.out.println(false||false);
        System.out.println(true||false);
        System.out.println(false||true);

        System.out.println("取反：");
        System.out.println(!true);
        System.out.println(!false);

        System.out.println("异或：");
        System.out.println(true^true);
        System.out.println(false^false);
        System.out.println(true^false);
        System.out.println(false^true);

    }
}
